<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	  xmlns:ui="http://java.sun.com/jsf/facelets"
	  xmlns:h="http://java.sun.com/jsf/html"
	  xmlns:c="http://java.sun.com/jsp/jstl/core">
	<head><title>IGNORED</title></head>
    <body>
		<ui:composition template="templates/layout.xhtml">
			<ui:define name="windowTitle">Daily Market</ui:define>
			<ui:define name="navigation"></ui:define>
			<ui:define name="content">
				<div id="content" class="graphic_bg">
					<c:choose>
						<c:when test="#{authenticationBean.authentication.authorized}">
							<span class="landing_large">
								Hello, <h:outputText style="font-weight: bold;" value="#{authenticationBean.userProfile.displayName}" />!
								[<h:link outcome="#{authenticationBean.profileOutcome}">My Account</h:link>]
							</span>
						</c:when>
						<c:otherwise>
							<h:form>
								<h:outputLabel for="signup_email" styleClass="landing_large">Enter your email address:</h:outputLabel>
								<br />
								<h:inputText id="signup_email" styleClass="landing_large" required="true" value="#{authenticationBean.signupEmail}" requiredMessage="#{msgs.email_invalid_detail}" validator="#{authenticationBean.validateEmail}" />
								<h:commandLink styleClass="image-button large" action="#{authenticationBean.doSignupCustomer}">Next</h:commandLink>
								<h:message for="signup_email" errorClass="message error" fatalClass="message error" warnClass="message warn" infoClass="message" styleClass="message" />
								<div id="signup_options">
									[<h:link outcome="login">Already a Customer?</h:link>] [<h:link outcome="partners">Partners</h:link>]
								</div>
							</h:form>
						</c:otherwise>
					</c:choose>
				</div>
				<br />
				<div id="frontpage_deals" class="graphic_bg">
					<div id="frontpage_deals_ticker">
						<div id="frontpage_deals_latest" class="frontpage_deals_ticker_page">
							<span class="h1 centre">Latest Deals</span>
							<c:forEach var="deal" items="#{dealView.homePageLatestDeals}" >
								<div class="deal-box" onclick="location.href = '#{deal.findDealUrl(deal.ID)}';">
									<h:outputText styleClass="deal-title" value="#{deal.shortDesc}" />
									<img src="#{deal.findDefaultImageUrl(150)}" alt="#{deal.shortDesc}" title="#{deal.shortDesc}" />
									<h:outputText styleClass="deal-pricetag" value="#{deal.priceDisplay}" />
								</div>
							</c:forEach>
						</div>
						<div id="frontpage_deals_ending" class="frontpage_deals_ticker_page" style="display: none;">
							<span class="h1 centre">Ending Soon</span>
							<c:forEach var="deal" items="#{dealView.homePageEndingSoonDeals}">
								<div class="deal-box" onclick="location.href = '#{deal.findDealUrl(deal.ID)}';">
									<h:outputText styleClass="deal-title" value="#{deal.shortDesc}" />
									<img src="#{deal.findDefaultImageUrl(150)}" alt="#{deal.shortDesc}" title="#{deal.shortDesc}" />
									<h:outputText styleClass="deal-pricetag" value="#{deal.priceDisplay}" />
									<h:outputText styleClass="deal-timer" value="#{deal.timeLeftDisplay}" style="#{deal.timeLeftStyle}" />
								</div>
							</c:forEach>
						</div>
					</div>
					<span class="links centre">[<h:link outcome="deals">All Deals</h:link>]</span>
				</div>
			</ui:define>
		</ui:composition>
	</body>
</html>

